package com.aike.controller;

import com.aike.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@Controller
@RequestMapping(value = "/Seat", produces={"text/html;charset=UTF-8;","application/json;"})
public class PersonController {

    @Autowired
    @Qualifier("personServiceImpl")
    private PersonService personService;

    @RequestMapping("/register")
    public String addRegister(String id, String password, Integer type)
    {
        return personService.register(id, password, type);
    }

    @RequestMapping("/updateMessage")
    public String updateMessage(Integer id, String password, String name, String sex, String email, String address, Integer credit, String imageUrl)
    {
        return personService.updateMessage(id, password, name, sex, email, address, credit, imageUrl);
    }

    //举报
    @RequestMapping("/addReport")
    public String addReport(Integer id, String text, String imageUrl)
    {
        return personService.addReport(id, text, imageUrl);
    }

    @RequestMapping("/clockIn")
    public String clockIn(Integer personId)
    {
        return personService.clockIn(personId);
    }


}
